package com.gg.common.mapper;

import com.gg.common.pojo.SPayDetails;
import com.gg.hj.view.OutMoneyTotal;
import com.gg.hj.view.SPayDetailsVo;
import com.gg.zjj.pojo.SPayDetailsView;

import java.util.List;

public interface SPayDetailsMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SPayDetails record);

    int insertSelective(SPayDetails record);

    SPayDetails selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SPayDetails record);

    int updateByPrimaryKey(SPayDetails record);

    /**
     * TODO 添加出库明细
     * @param sPayDetails
     * @throws Exception
     */
    void saveSPayDetails(List<SPayDetails> sPayDetails) throws Exception;

    /**
     * TODO 根据父级序号查询出库明细 和安全配置库存数量
     * @param parentId
     * @return SPayDetails
     * @throws Exception
     */
    List<SPayDetailsVo> queryWarehouseDetail(int parentId) throws Exception;

    /**
     * TODO 根据父级序号查询出库明细 制定出库单
     * @param parentId
     * @return
     * @throws Exception
     */
    List<SPayDetails> queryWarehouseDetailById(int parentId) throws Exception;

    /**
     * TODO 查询出库明细 安全库存数量 调度
     * @param id
     * @return SPayDetailsVo
     * @throws Exception
     */
    SPayDetailsVo queryWarehouseDispatchDetail(int id) throws Exception;

    /**
     * TODO 查询未被调度的产品
     * @param parentId
     * @return SPayDetails
     * @throws Exception
     */
    List<SPayDetails> queryByParentIdDispatchProducts(int parentId) throws Exception;

    /**
     * 根据父级序号查询产品已出库总成本
     * @param parentId
     * @return OutMoneyTotal
     * @throws Exception
     */
    OutMoneyTotal queryOutboundCost(int parentId) throws Exception;

    /**
     * TODO 查询出库明细产品是否已经全部出库
     * @param id
     * @return SPayDetails
     * @throws Exception
     */
    SPayDetails queryByIdOutWarehouse(int id) throws Exception;

    void bulkInsertIntoInventorySchedule(SPayDetailsView detailsView);
}